<?php

$dbh='';
require_once("config.php");

require_once("ThinMVC/ThinMVC.php");

session_start();

$uri='';

// If doing a "rewrite" as shown in the sample .htaccess file
// we can hide the root.php part of the URL
if (array_key_exists('REDIRECT_URL',$_SERVER)) {
	$uri=$_SERVER['REDIRECT_URL'];	

// Otherwise just go with it...
} else {
	$uri=$_SERVER['PATH_INFO'];
}

if ($uri=='/' || !($uri)) {
	header("Location: ".$config['default']);
}

$MVC=new ThinMVC( $config, $dbh );
$MVC->handleRequest( $_SERVER, $_REQUEST, $uri );
?>
